/**
 * @description 文档注册enter事件
 * @param {any} cb
 * @return {void}
 */
export const handleEnter = (cb: Function): void => {
  document.onkeydown = e => {
    const ev: KeyboardEventInit = window.event || e;
    if (ev.keyCode === 13) {
      cb()
    }
  }
}